[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
BSR               Bit Scan Reverse (386)             Flags: O D I T S Z A P C
                                                                      *
BSR destination, source

           Logic:        if a set bit is found in source
                           ZF . 1
                           destination . bit index of first set bit
                         else
                           ZF . 0

     This instruction scans an operand for the first set bit. BSF scans
     forward and BSR scans backwards. If a set bit is found in source,
     then the bit's index is placed in destination.

  --------------------------------------------------------------------------
   Operands                   Clocks   Transfers  Bytes  Example
   BSR  register, register                 -        3    BSR AX, DX
   BSR  register, memory                   -        3    BSR AX, MEMLOC5
  --------------------------------------------------------------------------

        Note:          Both registers and memory locations can be either
                       16 bits or 32 bits, but they must be the same length if
                       used in the same instruction.

See Also: BSF BT BTC BTR BTS
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson